<template>
	<div class="discover">
		<p>我是discover</p>
		<!--若页面 未在路由中配置，则跳转后，内容不显示-->
		<router-link to="/discover/discover-detail">跳转至详情页</router-link>
		<router-view></router-view>
		<br><br>
		<b @click="tClick">跳到 contact</b>
		<br><br>
		<a href="https://www.baidu.com/">百度</a>
		
		<br><br>
		<ul>
			<li v-for="(item,index) of list"
				 :key="index"
				 @click="handClick(index)"
				>
				{{item}}
			</li>
		</ul>
	</div>
	
</template>

<script>
import router from "../router"
export default {
  name: 'Discover',
  data () {
  	return {
  		list:["item1","item2","item3"]
  	}
  },
  methods:{
  	tClick:function(){		
		this.$router.push('/contact')		
		//当页面引入import router from "../router"时，可使用下面方法
  		//router.push('/contact');  		
  		//跳转到外链（其他外站）
  		// window.location.href = "https://www.baidu.com/"
  	},
  	handClick (index) {
  		router.push(`/contact/${index}`);//es6语法 "/content/"+index 
  	}
  }
}
</script>
<style scoped>
	p{font-size:25px;color:blue;}
</style>
